<template>
    <div class="bijnm">
        <div class="headf">
            <div>
                <h2><span class="hbnh"><a class="fan" @click="$router.back()"></a></span> {{ title }}</h2>
            </div>
        </div>
        <div class="hezi" v-show="type == '1'">
            <img src="~@/assets/imgRed/touxiang.jpg">
            <h6>软件名称</h6>
            <p>版本号：V1.1.2</p>
        </div>
        <div v-show="type != '1' && type != 5" class="hezi xxxxxxx" style="text-align: center !important;line-height: 0.5rem;">
            {{ type == 2 ? userInfo.companyInfo : type == 3 ? userInfo.certImg1 : type == 4 ? userInfo.certImg2 : type == 5 ?
                    userInfo.tradeAgreeText : type == 6 ? "如需此项服务请联系您的客户经理" : ''
            }}</div>
        <div v-show="type == 5" class="hezi xxxxxxx" style="text-align: center !important;line-height: 0.5rem;" v-html="userInfo.tradeAgreeText">
        </div>
    </div>
</template>
<script>
import * as api from '@/axios/api'
export default {
  name: 'about',
  created () {
    var that = this
    // 接收页面传值
    console.log(this.$route.query.e)
    if (this.$route.query.e) {
      switch (this.$route.query.e) {
        case '1':
          this.title = '版本更新'

          break
        case '2':
          this.title = '用户协议'
          break
        case '3':
          this.title = '隐私协议'
          break
        case '4':
          this.title = '关于我们'
          break
        case '5':
          this.title = '交易规则'
          break
        case '6':
          this.title = '暂未开放'
          break
        default:
          break
      }
      this.type = this.$route.query.e
    }
  },
  data () {
    return {
      title: '关于我们',
      type: 0,
      userInfo: {}
    }
  },
  mounted () {
    this.getUserInfo()
  },
  methods: {
    async getUserInfo () {
      // 获取用户信息
      let data = await api.getInfoSite()
      if (data.status === 0) {
        const userInfo = data.data
        userInfo.tradeAgreeText = userInfo.tradeAgreeText.replaceAll('\n', '<br>')
        this.userInfo = userInfo
      } else {

      }
    }
  }
}
</script>
<style scoped>
.bijnm {
    background: #fff;
    min-height: 100vh;
}

.headf {
    width: 100%;
    height: 1.1748rem;
    background: #F0F0F0;
}

h2 {
    text-align: center;
    height: 1.2549rem;
    width: 100%;
    position: relative;
    line-height: 1.2549rem;
    font-size: 0.4806rem;
    color: black;
    background: transparent;
    font-weight: 500;
    z-index: 3;
}

.hbnh {
    position: absolute;
    left: 0.4005rem;
    font-size: 0.4272rem;
    font-weight: 500;
}

.fan {
                    width: 0.5rem;
                    height: 0.5rem;
                    background: url() no-repeat 50%;
                    background-size: 100%;
                    display: inline-block;
                    margin-right: 0.13rem;
                    vertical-align: middle;
                    margin-top: -0.05rem;
                }

.hezi {
    width: 9.2115rem;
    border-bottom: 0.0267rem solid #e0e0e0;
    margin: 0 auto;
    margin-top: 1.1748rem;
    text-align: center;
    padding-bottom: 0.534rem;
}
</style>
